﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Ccr.Core;
using XcoAppSpaces.Contracts.Service;

namespace XcoAppSpaces.Discovery
{
	interface IXcoDiscoveryService : IXcoStatefulService
	{
		bool IsServer { get; set; }
		string ServerAddress { get; set; }

		DiscoveryResponse Resolve<T>(string workerName) where T : IPort;

		void Register(string spaceAddress, Port<DiscoveryRequest> discoveryPort);
		void UnRegister(string spaceAddress);
		IEnumerable<ITask> ProcessDiscoveryRequest(DiscoveryRequest request);
	}
}
